package it.tcm.TeacherClassMate.beans;

import it.tcm.TeacherClassMate.facade.EquationManageBase;
import it.tcm.TeacherClassMate.util.Util;

public class OrderRowBean {
	
	private Integer id;
    private Integer idOrder;
	private Integer idTypology;
	private Integer idForm;
	private Integer points;
	private Integer position;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getIdOrder() {
		return idOrder;
	}
	public void setIdOrder(Integer idOrder) {
		this.idOrder = idOrder;
	}
	public Integer getIdTypology() {
		return idTypology;
	}
	public void setIdTypology(Integer idTypology) {
		this.idTypology = idTypology;
	}
	public Integer getIdForm() {
		return idForm;
	}
	public void setIdForm(Integer idForm) {
		this.idForm = idForm;
	}
	
	public Integer getPoints() {
		return points;
	}
	public void setPoints(Integer points) {
		this.points = points;
	}
	public Integer getPosition() {
		return position;
	}
	public void setPosition(Integer position) {
		this.position = position;
	}
	public String getTable() {
		if (idTypology.equals(Util.EQUATIONS_TYPOLOGY)) {
			return Util.EQUATION;
		} else return null;
	}
	
	public String getDifficolta() {
		if (idTypology.equals(Util.EQUATIONS_TYPOLOGY)) {
			EquationManageBase eqm = new EquationManageBase();
			EquationBean eq = eqm.getEquationById(idForm);
			return eq.getDifficolta().toString();
		} else return null;
	}
	
	public String getIdFormula() {
		if (idForm < 10) return "0"+idForm.toString();
		else return idForm.toString();
	}
	

}
